]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
history: Use strict equality checks
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Thu, 11 Feb 2021 22:28:55 +0000 (23:28 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 13 Feb 2021 08:58:20 +0000 (08:58 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1653>

js/misc/history.js

index 1fba770090f1eca18f3bf22f1156e1802eade851..c7859953d675d5c5e27f6ad1a01f342754c49655 100644 (file)
@@ -60,7 +60,7 @@ var HistoryManager = class {
     }
 
     lastItem() {
-        if (this._historyIndex != this._history.length) {
+        if (this._historyIndex !== this._history.length) {
             this._historyIndex = this._history.length;
             this._indexChanged();
         }
@@ -69,9 +69,9 @@ var HistoryManager = class {
     }
 
     addItem(input) {
-        if (this._history.length == 0 ||
-            this._history[this._history.length - 1] != input) {
-            this._history = this._history.filter(entry => entry != input);
+        if (this._history.length === 0 ||
+            this._history[this._history.length - 1] !== input) {
+            this._history = this._history.filter(entry => entry !== input);
             this._history.push(input);
             this._save();
         }
@@ -80,9 +80,9 @@ var HistoryManager = class {
 
     _onEntryKeyPress(entry, event) {
         let symbol = event.get_key_symbol();
-        if (symbol == Clutter.KEY_Up)
+        if (symbol === Clutter.KEY_Up)
             return this._setPrevItem(entry.get_text());
-        else if (symbol == Clutter.KEY_Down)
+        else if (symbol === Clutter.KEY_Down)
             return this._setNextItem(entry.get_text());
 
         return Clutter.EVENT_PROPAGATE;